package com.briup.cms.web.controller;

import com.briup.cms.bean.BaseLog;
import com.briup.cms.service.IBaseLogService;
import com.briup.cms.utils.MessageUtil;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.briup.cms.utils.Message;

@Api(tags = {"日志相关接口"})
 @RestController
 @RequestMapping("/auth/log")
public class BaseLogController
 {
  @Autowired
  private IBaseLogService baseLogService;

  @ApiOperation("分页查询日志信息")
  @ApiImplicitParams({
          @ApiImplicitParam(name = "pageNum", value = "当前页", required = true, paramType = "query"),
          @ApiImplicitParam(name = "pageSize", value = "每页大小", required = true, paramType = "query")})
  @GetMapping("/pageQuery")
  public Message pageQuery(int pageNum, int pageSize) {
    PageInfo<BaseLog> data = baseLogService.findAll(pageNum, pageSize);
   return MessageUtil.success(data);
  }
  @ApiOperation("删除日志信息")
  @DeleteMapping("deleteById")
  @ApiImplicitParams({
          @ApiImplicitParam(name ="id",value = "用户编号",required = true,paramType = "query"),
  })
  public Message deleteById(Long id){
   baseLogService.deleteById(id);
   return MessageUtil.success();
  }

}
